# Sustainable Office Designer
# by Fabian Ritter <Fabian.Ritter@live.de>, 2012

module SOD
  
  class ProjectInfo
    
    attr_accessor :roomsize, :flexibility, :numberOfStoreys
    attr_reader :getConstruction
    attr_reader :minRoomHeight, :minConstructionHeight, :overallHeight, :totalHeight
    
    def initialize(roomsize = "0-50sm", flexibility = "low", numberOfStoreys = 1)
      @roomsize = roomsize
      @flexibility = flexibility
      @numberOfStoreys = numberOfStoreys
      
      getConstruction
    end
    
    def setValues(roomsize, flexibility, levels)
      @roomsize = roomsize
      @flexibility = flexibility
      @minRoomHeight = Plugin.designRules.levelHeight(roomsize)
      @minConstructionHeight = Plugin.designRules.constructionHeight(flexibility)
      
      @overallHeight = @minConstructionHeight + @minRoomHeight
      @numberOfStoreys = levels.to_i
      @totalHeight = @overallHeight * levels.to_i
    end
    
    def getConstruction
      puts @roomsize if $debug
      @minRoomHeight = Plugin.designRules.levelHeight(@roomsize)
      puts @flexibility if $debug
      @minConstructionHeight = Plugin.designRules.constructionHeight(@flexibility)
      puts @minRoomHeight, @minConstructionHeight if $debug
      @overallHeight = @minConstructionHeight + @minRoomHeight
      @totalHeight = @overallHeight * @numberOfStoreys
    end
    
  end
  
end
